package net.tuanhiep1232.medicine.client;

import net.tuanhiep1232.medicine.client.menu.RibbonMenu;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class medicine implements EntryPoint {
	/**
	 * The message displayed to the user when the server cannot be reached or
	 * returns an error.
	 */
	/**
	 * Create a remote service proxy to talk to the server-side Greeting
	 * service.
	 */
	private final GreetingServiceAsync greetingService = GWT
			.create(GreetingService.class);

//	private final Messages messages = GWT.create(Messages.class);

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		MainLayout mainLayout = new MainLayout();
		RibbonMenu ribbonMenu = new RibbonMenu(mainLayout.getMenu());
		RootPanel.get("gwtRibbonMenu").add(ribbonMenu);
		ribbonMenu.addMenu("ABC", "#AAAAAA", new Label("Nguyen tri tuanhiep"));
		
		RootPanel.get("gwtcontent").add(mainLayout);
		greetingService.greetServer("tuanhiep1232", new AsyncCallback<String>() {
			@Override
			public void onFailure(Throwable arg0) {
				Window.alert(arg0.getMessage());
			}
			@Override
			public void onSuccess(String arg0) {
				Window.alert(arg0);
			}
		});
		
	}
}
